<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <cpn></cpn>
    </div>





    <template id="CPN">
        <div>
            <h2>我是子组件</h2>
            <button @click="btnClick">我是子组件的按钮</button>
        </div>
    </template>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                message: '我是你爹!'
            },
            methods: {},
            components: {
                cpn: {
                    template: '#CPN',
                    methods: {
                        btnClick() {
                            console.log(this.$parent);
                        }
                    },
                },
            }
        });
    </script>
</body>

</html>